import { TrackOpTypes } from "./operations.js";

let shouldTrack = true;
const pauseTrack = () => {
    shouldTrack = false;
}
const resumeTrack = () => {
    shouldTrack = true;
}

const track = (target, type, key) => {
    if (!shouldTrack) {
        return;
    }
    if (type === TrackOpTypes.ITERATE) {
        console.log(`%c【${type}】`, 'color:#f00');
        return;
    }
    console.log(`%c【${type}】`, 'color:#f00', key);
}

const trigger = (target, type, key) => {
    console.log(`%c【${type}】`, 'color:#0f0', key);
}
export {
    track,
    trigger,
    pauseTrack,
    resumeTrack
}